package routers

import (
	"time"

	"github.com/lunny/tango"
	"github.com/tango-contrib/binding"
	"github.com/tango-contrib/session"
)

type ReJson struct {
	Code    int64
	Message string
	Obj     interface{}
}

func Load(t *tango.Tango) {

	t.Use(binding.Bind())
	t.Use(session.New(session.Options{
		MaxAge: time.Minute * 20,
	}))

	t.Get("/listTop", new(Action))
	t.Post("/addTop", new(Action))
	t.Route("GET:IsLogin", "/isLogin", new(Action))
	t.Route("POST:Login", "/login", new(Action))
	t.Route("GET:Logout", "/logout", new(Action))
	t.Route("POST:PushEdit", "/pushEdit", new(Action))
	t.Route("GET:ListArticle", "/listArticle/(:id[0-9]+)", new(Action))
	t.Route("GET:GetArticle", "/getArticle/(:id[0-9]+)", new(Action))

}
